package com.sjx.boundarycallback.ui

import android.content.Context
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import com.sjx.boundarycallback.utils.JumpActivityUtils
import com.sjx.boundarycallback.MainActivity
import com.sjx.boundarycallback.R
import com.sjx.boundarycallback.databinding.ActivityButtonBinding

class ButtonActivity : AppCompatActivity() {
    private var mBinding: ActivityButtonBinding? = null
    private var mContext: Context? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mContext = this
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_button)
        initData()
    }

    private fun initData() {
        mBinding!!.let {
            it.btnVolume.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, VolumeActivity::class.java, bundle)
            }
            it.btnColor.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, PublishActivity::class.java, bundle)
            }
            it.btnArcSlider.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, SeekBarActivity::class.java, bundle)
            }
            it.btnPaging.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, MainActivity::class.java, bundle)
            }
            it.btnDialog.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, DialogActivity::class.java, bundle)
            }
            it.btnDownloadResource.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, FileDownloadActivity::class.java, bundle)
            }
            it.btnEntranceThreadPool.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, ThreadPoolActivity::class.java, bundle)
            }
            it.btnEntranceRecyclerView.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, RecyclerViewActivity::class.java, bundle)
            }
            it.btnTabViewpager.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, TabLayoutActivity::class.java, bundle)
            }
            it.btnWifi.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, WifiActivity::class.java, bundle)
            }
            it.btnKotlin.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, KotlinActivity::class.java, bundle)
            }
            it.btnRefresh.setOnClickListener {
                val bundle = Bundle()
                JumpActivityUtils.jump(mContext, RefreshActivity::class.java, bundle)
            }
        }

    }
}